import req from "../../req";
import service from '@/utils/request'
import tool from '@/utils/tool';

// 获取点位列表
export function SpotList(data) {
	var a = {
	  client_id:1,
	  api_token:req('Spot/List'),
	  token:tool.data.get("TOKEN")
	}
	return service({
	  url: `Spot/List`,
	  method: 'post',
	  data:{...data,...a}
	});
  }

// 新增点位
export function AddSpot(data) {
	var a = {
	  client_id:1,
	  api_token:req('Spot/Add'),
	  token:tool.data.get("TOKEN")
	}
	return service({
	  url: `Spot/Add`,
	  method: 'post',
	  data:{...data,...a}
	});
  }


  // 编辑点位
export function EditSpot(data) {
	var a = {
	  client_id:1,
	  api_token:req('Spot/Edit'),
	  token:tool.data.get("TOKEN")
	}
	return service({
	  url: `Spot/Edit`,
	  method: 'post',
	  data:{...data,...a}
	});
  }


    // 删除点位
export function DeleteSpot(data) {
	var a = {
	  client_id:1,
	  api_token:req('Spot/Delete'),
	  token:tool.data.get("TOKEN")
	}
	return service({
	  url: `Spot/Delete`,
	  method: 'post',
	  data:{...data,...a}
	});
  }


//   获取设备列表
  export function DeviceListSpot() {
	var a = {
	  client_id:1,
	  api_token:req('Spot/DeviceList'),
	  token:tool.data.get("TOKEN")
	}
	return service({
	  url: `Spot/DeviceList`,
	  method: 'post',
	  data:{...a}
	});
  }


//   获取区域列表
export function AreaListSpot() {
	var a = {
	  client_id:1,
	  api_token:req('Spot/RegionList'),
	  token:tool.data.get("TOKEN")
	}
	return service({
	  url: `Spot/RegionList`,
	  method: 'post',
	  data:{...a}
	});
  }

